<?php

namespace App\Api\Controllers;

use App\Models\Teaching_plan;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;

class GetTeachingPlanController extends Controller
{
    public function get_zhangjie(Request $request)
    {
        $zhangId = $request->get('q');
        //dd($zhangId);
        return Teaching_plan::where('parent_id','=', $zhangId)->get(['id', DB::raw('title as text')]);
    }

    public function get_zhishidian(Request $request)
    {
        $jieId = $request->get('q');
        //dd($zhangId);
        return Teaching_plan::where('parent_id','=', $jieId)->get(['id', DB::raw('title as text')]);
    }
}
